<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="test">
			<input type="text" id="name" v-model="name" @keyup.enter="Add"
			@keyup.113="ft"/>
			<table>
				<thead>
					<tr>
						<td>name</td>
					</tr>
				</thead>
				<tbody>
					<tr v-for="item in list">
						<td>{{ item }}</td>
					</tr>
				</tbody>
			</table>
		</div>
		<script>
			//自定义修饰符
			Vue.config.keyCodes = {
				f2: 113,
			};
			var vue = new Vue({
				el:'#test',
				data:{
					list:['wzy','xjc'],
					name:''
				},
				methods:{
					Add(){
						this.list.push(this.name)
					},
					ft(){
						alert('f2!')
					}
				}
			})
		</script>
	</body>
</html>
